﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dycox.Linq
{
    public class GetDefaultSortOrderEventArgs : EventArgs
    {
        Dictionary<string, SortOrder> _dict;

        public GetDefaultSortOrderEventArgs()
        {
            _dict = new Dictionary<string, SortOrder>();
        }

        public SortOrder this[string key]
        {
            get
            {
                SortOrder so;

                if (_dict.TryGetValue(key, out so))
                    return so;
                else
                    return SortOrder.None;
            }
            set
            {
                if (key == null)
                    throw new ArgumentNullException("key");

                _dict[key] = value;
            }
        }

        public ICollection<string> Keys
        {
            get
            {
                return _dict.Keys;
            }
        }

        public int Count
        {
            get
            {
                return _dict.Count;
            }
        }
    }

    public delegate void GetDefaultSortOrderEventHandler(object sender, GetDefaultSortOrderEventArgs e);
}
